Design Twitter by Exponent
Requirements:
- Creating a tweet
- Viewing (or generating the timeline)
- Follow people and interact with tweets
- edit tweets? media in tweets? search?
Non-func requires:
- optimize for reads
- optimize for influencers
- high availability
- low latency (generation of timeline)
MVP:
APIs
- POST create tweet
- GET getTweets
- POST follow user
- POST like tweet
Design
- users --> load bals --> API servers --> Users&Tweets
How would you load distribute?
- round robin, geo location, consistent hashing
How does the Timeline Gen work?
- Looks at user and pulls in tweets (cache)
- Influencer service because they have special needs
- Push or pull method? hybrid based off activity
Followups
- Very popular small subset of tweets that are active, cache